<?php
header("Content-type: text/html; charset=utf-8");


$a=$_GET['name'];
$b=$_GET['time'];

$con=mysqli_connect("localhost","root","root","login");

if (mysqli_connect_errno())
{
    echo "连接失败: " . mysqli_connect_error();
}
 
$sql = "DELETE FROM messages 
        WHERE (name='$a') and (time='$b')";


$result = mysqli_query( $con, $sql );

if(!$result)
{
    echo("<script> alert('删除失败');parent.location.href='/blogger/history.php'; </script> " . mysqli_error($con));
}

echo "<script> alert('删除成功');parent.location.href='/blogger/history.php'; </script>";

mysqli_close($con);
?>